package com.gin.pixiv.api

import com.gin.pixiv.enums.WorkType
import com.gin.pixiv.response.PixivResponse
import com.gin.pixiv.response.bookmark.UserBookmark
import com.gin.pixiv.response.illustration.SimpleIllustration
import com.gin.pixiv.response.novel.SimpleNovel
import com.gin.pixiv.response.tag.BookmarkTagBody
import pixiv.enums.PixivRest
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query

/**
 * 用户收藏查询API
 * @author BX-Gin
 * @since 2024/2/29 14:51
 */
interface BookmarkQueryApi {
    /**
     * 查询用户使用收藏标签
     */
    @GET("ajax/user/{userId}/{type}/bookmark/tags")
    fun getBookmarkTags(
        @Path("type") type: WorkType,
        @Path("userId") userId: Long,
    ): Call<PixivResponse<BookmarkTagBody>>

    /**
     * 查询用户收藏的绘画作品
     */
    @GET("ajax/user/{userId}/illusts/bookmarks")
    fun getIllustrations(
        @Path("userId") userId: Long,
        @Query("rest") rest: PixivRest? = PixivRest.show,
        @Query("offset") offset: Int? = 0,
        @Query("limit") limit: Int? = 60,
        /**
         * 指定收藏标签, 指定未提供收藏标签的作品填 '未分類'
         */
        @Query("tag") tag: String? = "",
    ): Call<PixivResponse<UserBookmark<SimpleIllustration>>>

    /**
     * 查询用户收藏的小说
     */
    @GET("ajax/user/{userId}/novels/bookmarks")
    fun getNovels(
        @Path("userId") userId: Long,
        @Query("rest") rest: PixivRest? = PixivRest.show,
        @Query("offset") offset: Int? = 0,
        @Query("limit") limit: Int? = 60,
        /**
         * 指定收藏标签, 指定未提供收藏标签的作品填 '未分類'
         */
        @Query("tag") tag: String? = "",
    ): Call<PixivResponse<UserBookmark<SimpleNovel>>>

}